import React, {useRef} from "react";
import {getCurrentInstance} from "@tarojs/taro";
import {ScrollView, View} from "@tarojs/components";
import CommentList from "@/components/Comment/List";
import CommentImagePreview from "@/components/Comment/ImagePreview/index";

import './index.scss'

const CommentAllPage = () => {

  const refCommentList = useRef(null);
  const params = getCurrentInstance().router.params;

  return (
    <ScrollView className="commentAllPage" scrollWithAnimation scrollY onScrollToLower={()=>{refCommentList.current.nextPage()}}>
      <View className="commentAllContent">
        <CommentList ref={refCommentList} topicId={params.id} appId={params.appId} />
      </View>
      <CommentImagePreview />
    </ScrollView>
  )
}

export default CommentAllPage;
